home *** CD-ROM | disk | FTP | other *** search
- Path: god.bel.alcatel.be!btmpj7!ian
- From: ian@rsd.bel.alcatel.be (Ian Ward)
- Newsgroups: comp.lang.c
- Subject: Re: Tough FACTORIAL math problem...
- Date: 21 Feb 1996 08:00:45 GMT
- Organization: Alcatel Bell Telephone
- Distribution: world
- Message-ID: <4gejfd$olp@btmpjg.god.bel.alcatel.be>
- References: <312A49F0.167E@silk.gsfc.nasa.gov>
- Reply-To: ian@rsd.bel.alcatel.be
- NNTP-Posting-Host: btmpj7.rsd.bel.alcatel.be
-
- Thomas A. McGlynn said:
-
- > If you think about this long enough, it becomes clear that the last digit
- > then must be cyclic with a period of no longer than 40. Consider pairs of
- > last digits of numbers and their factorials. The last digit of the factorial
- > must be one of 2,4,6,8 (for n>1) so the combination of the last digit of
- > n and the last digit of n! must repeat within a cycle of 40 iterations.
- > But since the sequence of last digits of n is fixed (ie., 1234567890), and
- > we're starting with the same last digit of n!, the last digits of n! must
- > repeat. Thus the function should be writeable in terms of a lookup table
-
- I agree, it should, and I posted progressively more and more solutions to
- this theorised solution, last week, but it doesn't work.
-
-
- ---
- Ian Ward's opinions only : ian@rsd.bel.alcatel.be
-
- Fetch me the aspirin, learning this c++ is giving me a headache.
- - What Bruce Lee might have said, were he alive today.
-
-